<?php

class EmploymentContractTypeService extends BaseService
{

    private $employmentContractTypeDao;

    public function __construct()
    {
        $this->employmentContractTypeDao = new EmploymentContractTypeDao();
    }

    public function getEmploymentContractTypeDao()
    {
        if (!($this->employmentContractTypeDao instanceof EmploymentContractTypeDao)) {
            $this->employmentContractTypeDao = new EmploymentContractTypeDao();
        }
        return $this->employmentContractTypeDao;
    }

    public function setEmploymentContractTypeDao(EmploymentContractTypeDao $employmentContractTypeDao)
    {
        $this->employmentContractTypeDao = $employmentContractTypeDao;
    }

    /**
     * Returns EmploymentContractType list - By default this will returns the active employmentContractType list
     * To get the all the employmentContractTypes(with deleted) should pass the $activeOnly as false
     *
     * @param string $sortField
     * @param string $sortOrder
     * @param boolean $activeOnly
     * @return EmploymentContractType Doctrine collection
     */
    public function getEmploymentContractTypeList($sortField = 'code', $sortOrder = 'ASC', $activeOnly = true, $limit = null, $offset = null)
    {
        return $this->getEmploymentContractTypeDao()->getEmploymentContractTypeList($sortField, $sortOrder, $activeOnly, $limit, $offset);
    }

    /**
     * This will flag the employmentContractTypes as deleted
     *
     * @param array $toBeDeletedEmploymentContractTypeIds
     * @return int number of affected rows
     */
    public function deleteEmploymentContractType($toBeDeletedEmploymentContractTypeIds)
    {
        return $this->getEmploymentContractTypeDao()->deleteEmploymentContractType($toBeDeletedEmploymentContractTypeIds);
    }

    /**
     * Will return the EmploymentContractType doctrine object for a purticular id
     *
     * @param int $employmentContractTypeId
     * @return EmploymentContractType doctrine object
     */
    public function getEmploymentContractTypeById($employmentContractTypeId)
    {
        return $this->getEmploymentContractTypeDao()->getEmploymentContractTypeById($employmentContractTypeId);
    }

}

